#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int n; cin >> n;
    int cnt = 0;
    while (n != 1) {
        n >>= 1;
        cnt++;
    }
    int ans = pow(2, cnt);
    cout << ans << endl;
    return 0;
}